//
//  HomeViewCell.swift
//  LZFPhotoBrowser
//
//  Created by 梁梓烽 on 16/7/24.
//  Copyright © 2016年 liangzifeng. All rights reserved.
//

import UIKit
import SDWebImage

class HomeViewCell: UICollectionViewCell {
    
    @IBOutlet weak var imaegView: UIImageView!
    
    var shop : Shop? {
        
          didSet {
            
            // 1.nil值校验
            guard let urlString = shop?.q_pic_url else {
                return
            }
            
            // 2.创建URL
            let url = NSURL(string: urlString);
            let placeImage = UIImage(named: "empty_picture")
            
            self.imaegView.sd_setImageWithURL(url, placeholderImage: placeImage!)
        }
        
    }
    
}
